package CustomSwing;

import java.awt.Color;
import java.awt.Component;
import java.awt.GridBagLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.CompoundBorder;
import javax.swing.border.TitledBorder;

@SuppressWarnings("serial")
public class CTLPanel extends JPanel {
	public CTLPanel(Component comp, String title, int thickness) {
		setLayout(new GridBagLayout());
		add(comp);
		TitledBorder tb = BorderFactory.createTitledBorder(
				BorderFactory.createLineBorder(Color.black, thickness), title);
		tb.setTitleFont(comp.getFont());
		CompoundBorder b = BorderFactory.createCompoundBorder(
				tb, BorderFactory.createEmptyBorder(-8, 0, 0, 0));
		setBorder(b);
	}
}